package com.redxiii.spike.pmi.command;

import java.io.File;

import com.redxiii.spike.api.command.CommandFactory;
import com.redxiii.spike.api.communication.CommunicationService;
import com.redxiii.spike.api.message.ImMessage;
import com.redxiii.spike.api.message.Message;
import com.redxiii.spike.services.xmpp.XmppFileMessage;
import com.redxiii.spike.util.command.AbstractCommand;
import com.redxiii.spike.util.core.EngineSession;
import com.redxiii.spike.util.message.BasicMsgInterpreter;

/**
 * @author Daniel Filgueiras
 * 04/05/2011
 */
@CommandFactory(BasicMsgInterpreter.class)
public class TestFileSharing extends AbstractCommand {

	@Override
	public boolean proccess(Message message) {
		
		ImMessage xmppMessage = (ImMessage)message;
		CommunicationService service = EngineSession.getCommunicationService();
		
		File file = new File("spike.log") ;
		
		service.post(new XmppFileMessage(xmppMessage.getRemoteId(), file, "Teste"));
		
		return true;
	}

}
